package com.bwie;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableFeignClients
public class WinnerApplication {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
        SpringApplication.run(WinnerApplication.class,args);
    }

    /**
     * 创建redissClient对象
     * @return
     */
    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.80.192:6379");
        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }
}